<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
	<title>我的电商首页</title>
	<link rel="stylesheet" type="text/css" href="/tpshop/Public/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="/tpshop/Public/css/bootstrap-theme.min.css">
	<link rel="stylesheet" type="text/css" href="/tpshop/Public/css/style.css">
</head>
<body>
	<div class="container">
		<div class="row" id="header">
	<div class="col-md-3">
		<a href="/tpshop"><img id="logo" src="/tpshop/Public/img/logo.png"></a>
	</div>
	<div class="col-md-6">
		<p id="contact"><i class="glyphicon glyphicon-earphone"></i>+81 18325978982<i class="glyphicon glyphicon-envelope"></i>1139981169@qq.com</p>
		<div class="input-group">
			<input type="text" class="form-control" placeholder="请输入商品名或编号...">
			<span class="input-group-btn">
				<button class="btn co-blbl" type="button">搜索</button>
			</span>
		</div>
	</div>
	<div class="col-md-3">
		<div class="login_info">
			<?php if($_SESSION['user_is_login']){?>
				<span>欢迎回来,<?=$_SESSION['user_name']?></span> <a href="<?=U('user/logout')?>">退出</a>
			<?php }else{?>
				<a href="<?=U("user/login")?>">欢迎登录</a>
				<a href="<?=U("user/regedit")?>">快速注册</a>
			<?php }?>
		</div>
		<a href="<?=U('Home/shopping/cartlist')?>" id="shopcart" class="pull-right">
			<i class="glyphicon glyphicon-shopping-cart"></i>我的购物车
			<?php if($_SESSION['user_is_login']){?>
			<span><?=M('user_cart')->where('user_id ='.$_SESSION['user_id'])->count();?></span>
			<?php }?>
		</a>
	</div>
</div>


		<div class="row">
			<div class="col-md-3">
				<div id="menu">
					<div id="menu_title" class="list-group-item">
						<i class="glyphicon glyphicon-menu-hamburger"></i>所有分类
					</div>
					<ul class="list-group">
						<?php
 foreach ($catalogs as $ca) { ?>
						<li class="list-group-item"><a href="<?=U('Home/Product/lists/cataid/'.$ca['id'])?>"><?=$ca['name'];?></a></li>
						<?php
 } ?>
					</ul>
				</div>
			</div>
			<div class="col-md-9">
				<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
					<ol class="carousel-indicators">
						<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
						<li data-target="#carousel-example-generic" data-slide-to="1"></li>
						<li data-target="#carousel-example-generic" data-slide-to="2"></li>
					</ol>
					<div id="hg" class="carousel-inner panel" role="listbox">
						<div class="item active">
							<img src="/tpshop/Public/uploads/1.jpg">
						</div>
						<div class="item">
							<img src="/tpshop/Public/uploads/2.jpg">
						</div>
						<div class="item">
							<img src="/tpshop/Public/uploads/3.jpg">
						</div>
					</div>
					<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
						<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
						<span class="sr-only">Previous</span>
					</a>
					<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
						<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
						<span class="sr-only">Next</span>
					</a>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-8">
				<?php
 foreach ($products as $pr) { ?>
				<div class="h185 co-bl item-body col-md-6 panel panel-default">
					<div class="panel-body">
						<img class="thumbnail img125 item-img" src="/tpshop<?=($pr['img']);?>"/>
						<div class="title175h45">
							<a class="panel-title" href="<?=U('Home/Product/detail/id/'.$pr['id'])?>"><b><?=$pr['title'];?></b></a>
						</div>
						<p class="pw175h40 pull-left pcoloc"><?=$pr['desc'];?></p>
						<p class="text-danger"><b>¥<?=$pr['price'];?></b></p>
						<a id="nn" class="btn btn-danger" href="<?=U('Home/Product/detail/id/'.$pr['id'])?>">立即抢购</a>
					</div>
				</div>
				<?php
 } ?>
			</div>
			<div class="col-md-4">
				<div class="h185 co-bl panel panel-default">
					<div class="panel-body">
						<a href="#"><img class="thumbnail col-md-12" src="http://placehold.it/300x125?text=我是广告，请点我"/></a>
					</div>
				</div>
				<div class="h185 panel">
					<ul class="nav co-blbl nav-tabs nav-justified" role="tablist">
						<li role="presentation" class="active"><a class="list-ys" href="#notice" data-toggle="tab">公告</a></li>
						<li role="presentation"><a class="list-ys" href="#news" data-toggle="tab">新闻</a></li>
					</ul>
					<div class="tab-content">
						<div role="tabpanel" class="tab-pane active" id="notice">
							<ul class="list-group">
								<?php
 foreach ($notice as $no) { ?>
								<li class="list-group-item co-bl list-padd"><a class="list-ys" href="#"><?=$no['title'];?></a></li>
								<?php
 } ?>
							</ul>
						</div>
						<div role="tabpanel" class="tab-pane" id="news">
							<ul class="list-group">
								<?php
 foreach ($news as $ne) { ?>
								<li class="list-group-item co-bl list-padd"><a class="list-ys" href="#"><?=$ne['title'];?></a></li>
								<?php
 } ?>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
		<?php
 $catalogs_id = array(100); foreach ($catalogs_id as $ci) { $f_recommend=M("product")->where('cata_id = '.$ci.' and recommend =1')->find(); $floor=M("product")->where('cata_id = '.$ci.' and recommend =0')->limit(6)->select(); $cata=M("product_catalog")->where('id = '.$ci)->find(); ?>
		<div class="row">
			<div class="col-md-12">
				<p><span class="text-danger fb"><?=$ci?>f</span><?=$cata['name']?></p>
				<div class="pull-left kdyb co-bl qcjg panel panel-default">
					<div class="panel-body item-body">
						<img class="thumbnail img200 item-img" src="/tpshop<?=$f_recommend['img']?>"/>
						<div>
							<a class="panel-title" href="<?=U('Home/Product/detail/id/'.$f_recommend['id'])?>"><b><?=$f_recommend['title']?></b></a>
						</div>
						<p class="pcoloc"><?=$f_recommend['desc']?></p>
						<p class="text-danger"><b>¥<?=$f_recommend['price']?></b></p>
						<a id="nn" class="btn btn-danger" href="<?=U('Home/Product/detail/id/'.$f_recommend['id'])?>">立即抢购</a>
					</div>
				</div>
				<?php
 foreach ($floor as $f){ ?>
				<div class="pull-left kdybyb co-bl panel panel-default qcjg">
					<div class="panel-body nrjz">
						<img class="thumbnail img150" src="/tpshop<?=$f['img'];?>"/>
						<div class="titleh45">
							<a class="panel-title" href="<?=U('Home/Product/detail/id/'.$f['id'])?>"><b><?=$f['title'];?></b></a>
						</div>
						<p class="text-danger"><b>¥<?=$f['price'];?></b></p>
					</div>
				</div>
				<?php
 } ?>
			</div>
		</div>
		<br/>
		<?php
 } ?>
		<hr/>
		<div id="links" class="row">
			<div class="col-md-12">
				<ul>
					<li><a href="#">帮助中心</a></li>
					<li><a href="#">购物指南</a></li>
					<li><a href="#">配送方式</a></li>
					<li><a href="#">支付方式</a></li>
				</ul>
				<ul>
					<li><a href="#">技术支持</a></li>
					<li><a href="#">售后网点</a></li>
					<li><a href="#">常见问题</a></li>
				</ul>
				<ul>
					<li><a href="#">关于商城</a></li>
					<li><a href="#">公司介绍</a></li>
					<li><a href="#">商城简介</a></li>
					<li><a href="#">联系客服</a></li>
				</ul>
				<ul>
					<li><a href="#">关注我们</a></li>
					<li><a href="#">商城手机版</a></li>
				</ul>
				<ul>
					<li><a href="#">售后服务</a></li>
					<li><a href="#">保修政策</a></li>
					<li><a href="#">退换货政策</a></li>
					<li><a href="#">退换货流程</a></li>
				</ul>
			</div>
		</div>
		<hr/>
		<p id="copyright">
			未经goodjobs.cn同意，不得转载网站之所有招聘信息及作品 新安人才网版权所有&copy;2000-2016
			<br/>皖ICP备12018891号 经营许可证：皖B2-20080016
		</p>
	</div>
	<script type="text/javascript" src="/tpshop/Public/js/jquery-3.1.0.min.js"></script>
	<script type="text/javascript" src="/tpshop/Public/js/bootstrap.min.js"></script>
</body>
</html>